import rxAjax from '@/assets/js/ajax.js';
//表单公共 api接口
const PublicApi = {};

PublicApi.baseUrl= '/api-form/form/core/public';

PublicApi.getAppServices=function () {
  let url= PublicApi.baseUrl + '/getAppServices';
  return rxAjax.get(url);
}

PublicApi.getParams=function (setting) {
  let url= PublicApi.baseUrl + '/getParams';
  return rxAjax.postJson(url,setting).then(res=>{
      if(res.headers){
          delete res.headers;
      }
      return res;
  });
}

PublicApi.getFormCodegenTemplateTypes=function(){
  let url = PublicApi.baseUrl + '/getFormCodegenTemplateTypes';
  return rxAjax.get(url);
}

PublicApi.getFormCodegenBusinessSources=function(){
  let url = PublicApi.baseUrl + '/getFormCodegenBusinessSources';
  return rxAjax.get(url);
}

export  default PublicApi;
